package ui;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import po.Book;
import service.BookManager;
import service.impl.BookManagerImpl;


public class FindAllBooksServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
	private BookManager bm=new BookManagerImpl();
   
    public FindAllBooksServlet() {
        super();
    }

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		List<Book> bks=bm.findAllBooks();
		request.setAttribute("bks", bks);
		request.getRequestDispatcher("listAllBooks.jsp").forward(request, response);
	}
	
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
	}

}
